parse source prog_type result_flag called resolved ext host .
c_dir=path(called)
if ~showlist(H,'AWNPIPE') then address command 'mount >nil: awnpipe:'
'get selection var sel'
sel=translate(sel,' ','a0'x)
'get url var url'
parse arg mode opt .
if mode='u' then do
parse arg . url mode opt
sel=''
url=strip(url,'B','"')
end
if left(mode,3)='ask' then do
temp=mode
mode=opt
opt=temp
end
if sel='' then do
if left(opt,3)~='ask' then reqm=2
else do
reqm=reqch('"URL 'url'*NNo text selected.*NWhat would you like to translate ?" "Read _Docs|_URL|_ClipBoard|Co_n:|_Quit"')
if reqm=1 then do
'Open file://localhost/'c_dir'translate.html'
exit
end
if reqm=0 then exit
if reqm=3 then do
reqm=4
call open(cb,'awnpipe:clip/f/v','R')
sel=readch(cb,8000)
call close(cb)
end
else if reqm=4 then reqm=5
end
end
if length(mode)~=5 | substr(mode,3,1)~='_' then do
if mode='' then do
v1='unset'
mode=reqch('"Choose translation type.*NItaliano English Deutsch Português Français Español" "En>Fr|En>De|En>It|En>Pt|En>Es|Fr>En|De>En|It>En|Es>En|Pt>En|_Quit"')
end
else do
v1='invalid'
mode=reqch('"Configured translation type incorect*NChoose translation type.*NItaliano English Deutsch Português Français Español" "En>Fr|En>De|En>It|En>Pt|En>Es|Fr>En|De>En|It>En|Es>En|Pt>En|_Quit"')